<?php
/*
 * Created on May 6, 2009
 *
 * This "exports" a properties files directives into the application context
 * so that we can substitute placeholders with actual values. a place holder
 * follows the java properties standard of: ${variable}
 * 
 * we are NOT following the Smarty notation of: {$variable} for the specific reason
 * that we want to be as spring-like as possible, and that means being more java-like.
 * oh well, it is what it is.
 * 
 * author: David Palmer <blinder.dave@gmail.com>
 */
class PropertyPlaceholderConfigurer {
	private $locations = array();
	public $params = array();
	
	public function setLocations($locations) {
		$this->locations=$locations;
		
		foreach ($locations as $loc) {
			if (! $this->params) { 
				$this->params = parse_ini_file($loc);
			} else { 
				array_merge($this->params,parse_ini_file($loc));
			}
		}
	}
	
	public function getLocations() {
		return $this->locations;
	}
}
?>